<%-- 指令 --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.*" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="org.wanho.ums.User" %>
<html>
<head>
    <title></title>
</head>
<body>
    <!-- 这是HTML注释 -->
    <h2>welcome to jsp欢迎</h2>

    <%@ include file="hello.jsp"%>

    <%-- 小脚本 --%>
    <%
        String str = "hello";
        System.out.println(str);

        Date date = new Date();
        System.out.println(date);

        int age = 20;
    %>

    <%--  表达式  --%>
    <%=str %>
    <%=age*2-4 %>

    <%-- 声明  --%>
    <%!
        String sex = "男";

        public void show(){
            System.out.println("性别："+sex);
        }
    %>

    <%--  案例 --%>
    <%
        List<User> users = new ArrayList<>();
        users.add(new User(101,"aa","111",20,"编程","aa","男"));
        users.add(new User(102,"bb","111",24,"编程","aa","男"));
        users.add(new User(103,"cc","111",20,"编程","aa","男"));

        for (User u : users){
    %>
            <h3> <%=u.getName()%>，<%=u.getAge()%> </h3>
    <%
        }
    %>



</body>
</html>
